﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masterpage/QuanLy.Master" AutoEventWireup="true"
    CodeBehind="ChatRoom.aspx.cs" Inherits="DT5_Anh09110006_Hung09110044_Vu09110157.QuanLy.ChatRoom" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Hệ Thống Chatting</title>
    <style type="text/css">
        .div1
        {
            float: left;
        }
        .div2
        {
            float: left;
        }
        .txtNoiDung
        {
        	overflow:hidden;
        }
        .listMember
        {
        	margin-top: -2px;
        }
        tr th
        {
            color:Aqua;
        }
    </style>
    <script type="text/javascript">

        function _SetChatTextScrollPosition() {

            var chatText = document.getElementById("ChatText");

            chatText.scrollTop = chatText.scrollHeight;

            window.setTimeout("_SetChatTextScrollPosition()", 1);

        }

        window.onload = function () {

            _SetChatTextScrollPosition();

        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table border="1" cellspacing="0" cellpadding="0" width="100%">
                <tr>
                    <th>
                        Thành Viên
                    </th>
                    <th>
                        Nội Dung
                    </th>
                </tr>
                <tr>
                    <td width="100px">
                        <asp:ListBox ID="listThanhVien" runat="server" Height="340px" Width="100px" Font-Bold="True"
                            ForeColor="Red" CssClass="listMember"></asp:ListBox>
                    </td>
                    <td>
                        <div id="ChatText" style="overflow: scroll;">
                            <asp:BulletedList ID="bltNoiDung" runat="server" Height="300px" Width="95%" 
                                style="margin-left: 0px">
                            </asp:BulletedList>
                        </div>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnGui" EventName="click" />
            <asp:AsyncPostBackTrigger ControlID="btnXoa" EventName="click" />
            <asp:AsyncPostBackTrigger ControlID="ChatTimer" EventName="Tick" />
        </Triggers>
    </asp:UpdatePanel>
    <div class="div2">
        <asp:Button ID="btnXoa" runat="server" CssClass="XoaButton" Font-Bold="True" ForeColor="#FF9900"
            Text="Xóa Chat Box" Width="102px" OnClick="btnXoa_Click" />
    </div>
    <div class="div1">
        <asp:TextBox ID="txtTinNhan" runat="server" Width="720px" Font-Bold="False"></asp:TextBox>
        <asp:Button runat="server" Text="Gửi" ID="btnGui" Width="100px" OnClick="btnGui_Click"
            Font-Bold="True"></asp:Button>
    </div>
    <asp:Timer ID="ChatTimer" runat="server" Interval="1000">
    </asp:Timer>
</asp:Content>
